import sys

sys.path.insert(0, '../src')

from bindconf import BindConf


class A(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
    def show(self):
        print("A x: %d y: %d" % (self.x, self.y))

class B:
    def __init__(self, x):
        self.x = x
    
    def show(self):
        print("B x: %d" % (self.x))

if __name__ == '__main__':
    bconf = BindConf([A, B])
    bconf.bind('./model_config/proj.yaml')

    print(bconf.get_conf('A', 'hello'))


    # models = bconf.build(A, "hello")

    # models.show()

    # imodels = bconf.build(A, "world")

    # imodels.show()

    # bmodels = bconf.build(B, "ipro")
    # bmodels.show()

    # bconf.save()
    models = bconf.project()

    for key in models.keys():
            print(key, end=' ')
            models[key].show()
            # exit()
